package subumbo.demo.view.firework {
	import org.robotlegs.mvcs.Mediator;
	
	import subumbo.demo.model.WishModel;

	public class FireworkMediator extends Mediator {
		
		[Inject] public var _view:Firework;
		[Inject] public var wishModel:WishModel;
		
		public override function onRegister():void {
			var i:int;
			var text:String
			for(; i < 6; ++i) {
				text = wishModel["wish"+(i+1)];
				if(text == "") continue;
				_view.addEmitter(new TextEmitter(text) , 300, 250);
			}
			_view.start();
		}
		
		public override function onRemove():void {
			_view.dispose();
		}
	}
}